Conventionally, industrial controllers such as programmable controller (PC), motion controller (MC), numerical controller (NC), test controller and graphic operation terminal (GOT) have been used for measuring, monitoring and controlling various facilities. Examples of the languages used in measurement, monitoring and control programs executed by industrial controllers include the language in conformity with the IEC 61131-3 standard such as a ladder and a language dedicated to a controller. Further, examples of the languages for measurement, monitoring and control programs in a case of using a microcomputer in place of an industrial controller include the C language and assembly language.
Description is given below by taking a programmable controller (hereinafter, “PC”) as an example. The PC executes a measurement, monitoring and control program (hereinafter, “program”) to, for example, obtain the status of an object to be measured, monitored and controlled and direct an operation. The program is created with a predetermined program creation support device (for example, ladder creation support device) and is described mainly by variables, devices and numerical values.
The devices herein refer to ones obtained by assigning the input/output between the PC and an object to be measured, monitored and controlled which is connected with the PC to the memory address of the PC, and memory addresses used internally by the PC. For example, in the PC that supports the program creation support device (ladder creation support device) of Non-Patent Document 1 below, device characters are determined in advance in accordance with a data type such that one to which an input is assigned is a device X, one to which an output is assigned is a device Y, bit data that is internally used (internal relay) is a device M, and pieces of word data that are internally used (registers) are a device D and a device R. The addresses of the respective devices are expressed in hexadecimal for the device X and device Y and are expressed in decimal for the device M, device D and device R.
Variables indicate devices. In the PC that supports the program creation support device of Non-Patent Document 1, the variable is referred to as a “label” and is assigned to a specific device in compiling. A label is assigned to a device by being directly specified by a programmer in some cases or is assigned automatically in compiling in other cases. The characters usable as labels are characters other than the characters determined in advance, such as device characters. In the case of describing the program with the use of labels, it is possible to change the devices assigned to the labels of a program without changing the description of the program per se.
In the case of describing the numerical values in the ladder program, each numerical value is headed with a symbol K in decimal or a symbol H in hexadecimal. For example, “K25” represents a numerical value “25” in decimal form.
A program creation support device is typically provided as a software tool that operates on a personal computer (hereinafter, “computer”) and has a function of supporting editing of a program for measuring, monitoring and controlling facilities by the PC, as well as a function of transferring the program edited by a computer (or an execution code obtained by compilation thereof) to the PC through connection of the PC to the computer and a function of monitoring a status of a facility and a variable value and a device value that vary upon execution of the program.
Further, there is a graphic operation terminal (GOT) with a program edit function and a monitoring function provided by a program creation support device. This enables to edit a program or monitor a status on the GOT constantly connected to the PC.
While the specifications and program of a facility to be measured, monitored and controlled are electrically turned into data through description with a software tool that operates on a computer, the specifications and program are not related to each other in terms of electronic data. Therefore, the measuring, monitoring and control program is manually created with a program creation support device based on the specifications. This requires considerable efforts for creating a program that causes the functions described in the specifications to sufficiently operate without problems.
Nowadays, there is a program creation support device that segmentalizes a frequently-used program into components as program modules (program organization units (POUs)), and reuses the POUs that conform to the specifications of the facility, to thereby compose a program from a plurality of POUs. In a case where a program language is a ladder, POU corresponds to a subroutine or a functional block (FB), while in a case of a structured text (ST) or C language, POU corresponds to a subroutine or function.
Moreover, there is a program creation support device that has a macro function of naming (macro-naming) an appropriate program pattern consisting of a plurality of program components, registering the program pattern, and then in creating a program, invoking the program pattern for reuse (macro diversion). The use of a program creation support device capable of reusing program components in this manner reduces the efforts in creating a program.